import React from 'react'
// 脚步按钮组件
class FilterTodo extends React.Component {
  constructor(props) {
    super(props)
  }
  changeData = (sta) => {
    // 子传父 传递 数据状态  all 或done或no
    this.props.filterData(sta)
  }
  render () {
    return (
      <div>
        <button disabled={this.props.status == "all"} onClick={() => this.changeData('all')}>全部</button>
        <button disabled={this.props.status == "done"} onClick={() => this.changeData('done')}>已完成</button>
        <button disabled={this.props.status == "no"} onClick={() => this.changeData('no')}>未完成</button>
      </div>
    )
  }
}
export default FilterTodo